﻿using DevExpress.XtraEditors;
using DevExpress.XtraGrid.Demos.util;
using DXApplicationTangche.UC.门店出入库.Service;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace DXApplicationTangche.UC.门店出入库.UC
{
    public partial class XtraUserControl库存流水 : DevExpress.XtraEditors.XtraUserControl
    {
        private List<String> storeId = new List<String>();
        private String inOutFlag;
        public XtraUserControl库存流水(String inOutFlag, List<String> storeId)
        {
            InitializeComponent();
            this.storeId = storeId;
            this.inOutFlag = inOutFlag;
            this.refresh();
        }

        public void refresh()
        {
            this.gridControl库存流水.DataSource = 出入库Service.getStockInventoryDetails(this.inOutFlag,this.storeId);
            this.gridView库存流水.RefreshData();
        }

        private void simpleButton刷新_Click(object sender, EventArgs e)
        {
            this.refresh();
        }

        private void gridView库存流水_CustomColumnDisplayText(object sender, DevExpress.XtraGrid.Views.Base.CustomColumnDisplayTextEventArgs e)
        {
            if (e.Column.Name.Equals("gridColumnstyleSizeCd"))
            {
                if (!String.IsNullOrWhiteSpace(e.DisplayText))
                {
                    try { e.DisplayText = e.DisplayText.Replace("IGS_GROUP_SIZE-", "").Replace("EGS_GROUP_SIZE-", ""); } catch { }
                }
            }
        }
    }
}
